﻿using System;
using System.ServiceModel;
using System.Security.Permissions;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Infra.Service.ExceptionHandling;
using Sinacor.Infra.Common.Exceptions.FaultContracts;
using System.IO;
using Sinacor.Servico.Infra.FileTransfer.Service.DataContract.Request;
using Sinacor.Servico.Infra.FileTransfer.Service.DataContract.Response;
using System.Collections.Generic;

namespace Sinacor.Servico.Infra.FileTransfer.Service.ServiceContract
{
    /// <summary>
    /// Contrato de servico IFileRepositoryService
    /// </summary>
    [ExceptionShielding]
    [ServiceContract(Namespace = "http://www.bovespa.com.br/Sinacor.Servico.Infra.FileTransfer.Service.ServiceContract", Name = "IFileRepositoryService", SessionMode = SessionMode.Allowed)]
    public interface IFileRepositoryService
    {
        [OperationLog]
        [FaultContract(typeof(InvalidSessionFault))]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(LicensingFault))]
        [FaultContract(typeof(AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "DownloadFile")]
        FileInfoResponse DownloadFile(DownloadRequest request);

        [OperationLog]
        [FaultContract(typeof(InvalidSessionFault))]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(LicensingFault))]
        [FaultContract(typeof(AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "UploadFile")]
        void UploadFile(FileInfoRequest request);

        [OperationLog]
        [FaultContract(typeof(InvalidSessionFault))]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(LicensingFault))]
        [FaultContract(typeof(AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "DeleteFile")]
        void DeleteFile(StorageFileInfoRequest request);

        [OperationLog]
        [FaultContract(typeof(InvalidSessionFault))]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(LicensingFault))]
        [FaultContract(typeof(AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "ListFiles")]
        List<StorageFileInfoResponse> ListFiles(StorageFileInfoRequest request);
    }
}
